package com.polytech.diploma.SQLGenerator.Oracle.Arguments;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

public class ArgumentSet implements Argument{
	List<Argument> values = null;
	
	public ArgumentSet(Argument ... arguments)
	{
		values = new ArrayList<Argument>();
		
		 for (int i = 0; i < arguments.length; i++)
		{
			values.add(arguments[i]);
		}
	}
	
	public ArgumentSet() 
	{	
		values = new ArrayList<Argument>(); 
	}
	
	public void addArgument(Argument arg)
	{
		if(values == null)
			values = new ArrayList<Argument>();
		
		values.add(arg);
	}

	@Override
	public Map<String, List<String>> getTablesWithFields(
			Map<String, List<String>> fieldMap) {
		if(values != null)
			for(Argument arg : values)
			{
				fieldMap = arg.getTablesWithFields(fieldMap);
			}
		return fieldMap;
	}
}
